import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

Vue.config.productionTip = false;

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

Vue.use(ElementUI);

Vue.filter("filtime", (val) => {
  let res = new Date(val);
  let year = res.getFullYear();
  let month = res.getMonth() + 1;
  let day = res.getDate();
  let hours = res.getHours();
  let mines = res.getMinutes();
  let second = res.getSeconds();

  let fmines = String(mines).padStart(2, "0");
  // string方法转化为字符串 padStart把这个字符串不够两位的用0补全两位
  return `${year}/${month}/${day} ${hours}:${fmines}`;
});
//全局过滤器  过滤器的名字 后面是一个函数  函数里面的参数是要过滤的值

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
